
<#assign className=table.className>


<#assign classNameFirstLower=className?uncap_first>


<#assign classNameLowerCase=className?lower_case>


<#if table.idColumn.javaType=="java.lang.Integer">


<#assign pkJavaType="java.lang.Long">


<#else>


<#assign pkJavaType=table.idColumn.javaType>


</#if>
package ${controller_package};

import ${commonNamespace}.support.AjaxResponse;
import ${commonNamespace}.support.CP_GlobalNamingConstant;
import ${commonNamespace}.support.CP_OperateLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import ${model_package}.${className};
import ${service_package}.I${className}Service;

import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;



/**
 * Description: <${modulName}模块controller >. <br>
 * <p>
 * <基本的crud>
 * </p>
 * generate time:${.now}
 *
 * @author ${author}
 * @version V1.0
 */

@RestController
@Slf4j
@RequestMapping("/${modulName}")
public class ${className}Controller{


	@Resource(name = "${classNameFirstLower}Service")
	protected I${className}Service ${classNameFirstLower}Service;



	/**
	 * 查询全部${className}.
	 *
	 * @return AjaxResponse
	 */
	@RequestMapping(value = "/${classNameFirstLower}s")
	@CP_OperateLog(value = "查询全部${className}", type = CP_GlobalNamingConstant.OPERATE_LIST)
	public AjaxResponse ${classNameFirstLower}s() {
		final List<${className}> ${classNameFirstLower}List = ${classNameFirstLower}Service.findAll();
		return AjaxResponse.success(${classNameFirstLower}List);
	}


}

